<?php

namespace App\Models;

use Illuminate\Database\Eloquent\SoftDeletes;
use function PHPSTORM_META\map;


class Absence extends BaseModel
{

    use SoftDeletes;


    protected $table = 'absence';

    const VACATION = 'annual';//年假
    const SHIFT = 'rest';//调休
    const LEAVE  = 'casual';//事假
    const MEDICAL = 'sick';//病假

    const ABSNCE_TYPE = [
        self::VACATION => '年假',
        self::SHIFT => '调休',
        self::LEAVE => '事假',
        self::MEDICAL => '病假'
    ];

    public function users(){
        return $this->belongsTo(User::class, 'user_id');
    }

}
